package com.example.a2023110445
import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import androidx.appcompat.app.AppCompatActivity

class   Activity2 : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity2)

        val inputEditText: EditText = findViewById(R.id.inputEditText)
        val submitButton: Button = findViewById(R.id.submitButton)
        val cancelButton: Button = findViewById(R.id.cancelButton)

        submitButton.setOnClickListener {
            val inputData = inputEditText.text.toString()
            val resultIntent = Intent()
            resultIntent.putExtra("returnData", inputData)
            setResult(RESULT_OK, resultIntent)
            finish()
        }

        cancelButton.setOnClickListener {
            finish()
        }
    }
}

